//
//  FWAttentOrderCell.m
//  BirdLoveSheep
//
//  Created by wwj on 16/3/11.
//  Copyright © 2016年 wwj. All rights reserved.
//

#import "FWAttentOrderCell.h"
#import "FWTagsModel.h"
#import <UIImageView+WebCache.h>

@interface FWAttentOrderCell ()
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *countLabel;
@end

@implementation FWAttentOrderCell

- (void)awakeFromNib {
    self.iconView.layer.cornerRadius = 5;
    self.iconView.layer.masksToBounds = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(FWTagsModel *)model{
    _model = model;
    self.nameLabel.text = _model.theme_name;
    NSString *subStr = @"";
    if (_model.sub_number < 10000) {
        subStr = [NSString stringWithFormat:@"已有%d人订阅", _model.sub_number];
    }else{
        subStr = [NSString stringWithFormat:@"已有%.1f1万人订阅", _model.sub_number/10000.0];
    }
    [self.iconView sd_setImageWithURL:[NSURL URLWithString:_model.image_list]];
    self.countLabel.text = subStr;
}

-(void)setFrame:(CGRect)frame{
    frame.size.height -=1;
    [super setFrame:frame];
}

@end
